import http from '@/utils/request.js'
// 获取文章分类列表
export const reqGetArtCateList = () => {
  return http({
    method: 'GET',
    url: '/my/cate/list'
  })
}
// 新增文章分类列表
export const reqAddArtcleCate = (data) => {
  return http({
    method: 'POST',
    url: '/my/cate/add',
    data
  })
}

// 删除文章分类
export const reqDelArtCateById = (id) => {
  return http({
    method: 'delete',
    url: '/my/cate/del',
    params: {
      id
    }
  })
}
// 修改文章分类
export const reqEditArtCateById = (id) => {
  return http({
    method: 'GET',
    url: '/my/cate/info',
    params: {
      id
    }
  })
}
// 修改文章分类
export const reqPutEditArtCateById = (data) => {
  return http({
    method: 'PUT',
    url: '/my/cate/info',
    data
  })
}

// 获取文章的列表数据
export const reqGetArtList = (params) => {
  return http({
    method: 'GET',
    url: '/my/article/list',
    params
  })
}

// 根据 id 删除文章数据
export const reqDelArtById = (id) => {
  return http({
    method: 'DELETE',
    url: '/my/article/info',
    params: {
      id
    }
  })
}

// 根据 id 获取文章详情
export const reqGetArtInfoById = (id) => {
  return http({
    method: 'GET',
    url: '/my/article/info',
    params: {
      id
    }
  })
}

// 发布新文章
export const reqPublishArticle = (data) => {
  return http({
    method: 'POST',
    url: '/my/article/add',
    data
  })
}
